'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller, middleware } = app;
  const { auth } = middleware;

  // 上传
  router.post('/api/upload/file', controller.upload.file);
  // banner
  router.get('/api/banner/list', controller.banner.allList);
  router.resources('banner', '/api/banner', controller.banner);
  // 个人数据
  router.get('/api/member/fish', controller.member.fish);
  router.get('/api/member/lure', controller.member.lure);
  router.get('/api/member/day', controller.member.day);

  // 会员
  router.post('/api/member/login', controller.member.login);
  router.post('/api/member', controller.member.create);
  router.get('/api/member/list', controller.member.allList);
  router.resources('member', '/api/member', controller.member);
  // 后台用户
    router.post('/api/user/login', controller.user.login);
  router.resources('user', '/api/user', controller.user);
    // 后台角色
    router.resources('role', '/api/role', controller.role);
    // 鱼种
    router.get('/api/fish/list', controller.fish.allList);
    router.resources('fish', '/api/fish', controller.fish);
    // 路亚
    router.get('/api/lure/list', controller.lure.allList);
    router.resources('lure', '/api/lure', controller.lure);
    // 鱼获
    router.get('/api/fishCatch/list', controller.fishCatch.allList);
    router.resources('fishCatch', '/api/fishCatch', controller.fishCatch);
    // 朋友圈
    router.get('/api/friend/list', controller.friend.allList);
    router.resources('friend', '/api/friend', controller.friend);
    // 朋友圈评论
    router.get('/api/friendComment/list', controller.friendComment.allList);
    router.resources('friendComment', '/api/friendComment', controller.friendComment);
    // 朋友圈点赞
    router.get('/api/friendLike/list', controller.friendLike.allList);
    router.resources('friendLike', '/api/friendLike', controller.friendLike);
    // 花费
    router.get('/api/cost/list', controller.cost.allList);
    router.resources('cost', '/api/cost', controller.cost);
    // 打龟
    router.get('/api/turtle/list', controller.turtle.allList);
    router.resources('turtle', '/api/turtle', controller.turtle);
    // 一起玩
    router.get('/api/play/list', controller.play.allList);
    router.resources('play', '/api/play', controller.play);
  router.get('/api/data/rank', controller.data.rank);
  router.get('/api/data/total', controller.data.total);

};
